//--------------------------------------------------------------
//
// Qizhi Zhang 
// ezhung@gmail.com
// http://www.moorwind.com
//
//--------------------------------------------------------------
package reader.view.components
{
	import mx.controls.listClasses.ListItemRenderer;
	import mx.events.FlexEvent;
	
	[Style(name="enableDisabledColor", type="uint", format="Color", inherit="no")]
	[Style(name="disableDisabledColor", type="uint", format="Color", inherit="no")] 
	
	public class DisabledListItemRenderer extends ListItemRenderer
	{
		public function DisabledListItemRenderer()
		{
			this.addEventListener(FlexEvent.CREATION_COMPLETE, onCreateComplete_handler, false, 0, true);
		}
		
		private function onCreateComplete_handler(e:FlexEvent):void
		{
			if(data)
			{
				setStyle("color", data.enable ? getStyle("enableDisabledColor") : getStyle("disableDisabledColor"));
			}
		}

	}
}